home *** CD-ROM | disk | FTP | other *** search
- Path: EU.net!sun4nl!xs4all!usenet
- From: stijnw@xs4all.nl (Stijn Wolters)
- Newsgroups: comp.lang.c
- Subject: Re: string search?
- Date: Thu, 28 Mar 1996 17:54:19 GMT
- Organization: XS4ALL, networking for the masses
- Message-ID: <4jek23$ba9@news.xs4all.nl>
- References: <4jbmtk$78k@dfw-ixnews3.ix.netcom.com>
- NNTP-Posting-Host: asd09-23.dial.xs4all.nl
- X-Newsreader: Forte Free Agent 1.0.82
-
- rmor1@ix.netcom.com(Ricardo Mor ) wrote:
-
- > How can I search for a string of characters within another string?
- >for example..
-
- > string = "NEXT_TIME";
- >
- > string2 = "NEXT";
-
- > how can I find string2 in string?
-
- In "string.h" is a function "strstr", which is (I think) the function
- you are looking for:
-
- char *strstr(char *s1, char *s2);
-
- strstr returns a pointer to the position where s2 occurs for the first
- time in s1, it returns NULL if s2 is not found in s1.
-
- Greetings,
- Stijn Wolters (stijnw@xs4all.nl)
-
-
-
-